Get Transaction Details [TransactionDetail]

TransactionDetail

Get Transaction Detail

This interface is used to get the details of the specified transaction. Currently, only five types of transaction queries are supported, including adding, modifying, deleting, truncating, and merging table data. The permissions of adding table, modifying table, truncating table, deleting table, and merging table data are still used.

Request address

GET/POST
http://OmsAddress/app/newoms.php/webservice/oamp/transaction/detail/<set_id>/<trans_id>?cmd=cmdVal&ip-type=webservicerest&access-token=AccessTokenVal

GET parameter description in url

Parameter nameData typeDescriptionWhether the field is requiredRemarks
set_idintegerset id of the transactionYes
trans_idintegertransaction idYes
cmd (cmdVal)integerInterface type. Get the table-adding transaction: cmd = 10002; get the table-modifying transaction: cmd = 10003; get the table-truncating transaction: cmd = 10004; get the table-deleting transaction: cmd = 10005; get the zone-deleting transaction: cmd = 10006; get the data-merging transaction: cmd = 10008; (table, process) data backup cmd: 10009; table data construction cmd: 10011; host data construction cmd: 10012 data import transaction cmd: 10013; index transaction cmd: 10022Yes

POST request parameter description

Parameter nameData typeDescriptionWhether the field is requiredRemarks
get_actionInteger (0, 1)Whether to return the action list of the transaction. 0: Do not return; 1: Return.Nooms:3.38.1

Data Parameters

Use json format to represent the record related information. The following is an example:

{
    "get_action": 0
}

Return Syntax

Return Parameter Description

  1. When the returned status code is not 200, it indicates that the query was unsuccessful, and the returned data is error message

  2. When the returned status code is 200, it indicates that the transaction details are got successfully

Description of transaction fields

Field nameField typeField meaning
Iduint32Transaction id
SetIduint32set id of the transaction
AppIdint32app id, the app id of some types of transactions is meaningless and has no value
ZoneIdint32zone id, the zone id of some types of transactions is meaningless and has no value
Typeuint32transaction type
Statusuint32Status code. For the meaning of each status code, see the description of "transaction status list and status transformation that can be realized by using the web service interface" in this interface
CanRedotinyintWhether it can be redone
CanSuspendtinyintWhether it can be suspended
CanRollbacktinyintWhether it can be rolled back
Reasonuint32Status reason code
Numuint32Number of resources involved
IdNamestringTable name, process ID, and node name
DatastringData information
MemostringRemarks
CreateUserstringTransaction creator
CreateTimedatetimeTransaction creation time
UpdateTimedatetimeTransaction update time
ExtendInfostringFor the expansion/shrinkage transaction, this field stores the ID of the CleanShardData transaction. For the CleanShardData transaction, this field stores the ID of expansion/shrinkage transaction, such as cmId = 72415; Other uses can be defined by yourself
MaxConcurrentCountuint32Maximum number of parallel actions in a transaction. The maximum value is 10

Description of each field of the transaction’s action

Field nameField typeField meaning
TransIduint32Transaction id of the transaction to which action belongs
Iduint32action id
AppIdint32app id
ZoneIdint32zone id
Typeuint32action type
Statusuint32Status code, meaning of each status code is as follows: Status = 1: Initializing Status = 2: Resource ready, to be executed Status = 3: Executing Status = 4: Suspending Status = 5: Rolling back Status = 6: Completed Status=7: End Status = 8: To be recovered Status = 9: Skip
Reasonuint32Status reason code
Numuint32Number of resources involved
IdNamestringTable name will be saved in the case of table operation; process id will be saved in the case of process operation
DatastringData information
ContextstringContext information of the running action
CreateTimedatetimeCreation time
ExecuteTimedatetimeExecution time
UpdateTimedatetimeUpdate time

The transaction status list and the status transformation that can be realized by using the web service interface

Status aState a can be transformed into state bOMS interface used by state a => state b
To be executed (Status = 1)Waiting for execution; FailoverExecute transactions (webservice can be called); Fail over transaction (webservice cannot be called)
Waiting for execution (Status = 2)None
Preparation before execution (Status = 3)None
Executing (Status = 4)SuspendedSuspend transaction (webservice is not callable)
Suspending (Status=5)To be recovered; Fail overRecover transaction (webservice can be called); Fail over transaction
To be recovered (Status = 6)None
To be rolled back (Status = 7)None
Rolling back (Status = 8)FailoverFail over transaction
Successfully completed (Status = 9). This status is the end of the transaction. No further operations can be performedNone
Failover (Status = 10). This status is the end of the transaction. No further operations can be performedNone
Paused (Status = 1000)

Request Example

Send A Request through the Curl Method

For the parameters in the command, please refer to the “Description of POST Request Parameters” on this page. For the method to obtain access-token, see: Get access-token

curl -H “Content-type: application/json” -X “GET” -d ’{
    “get_action”: 0
}’ http://omsaddress/app/newoms.php/webservice/oamp/transaction/detail/%3Cset\_id%3E/%3Ctrans\_id%3E?cmd=cmdVal&ip-type=webservicerest&access-token=\\&set\_id=\\&trans\_id=\\

Return Example

Successful Return Example

Status of http request = 200

  1. An example of successfully getting the details of a table-adding transaction
{
    "Id": 300,
    "AppId": 2,
    "ZoneId": 5,
    "Type": 283,
    "Status": 9,
    "Reason": 0,
    "Num": 0,
    "IdName": "add_table350",
    "Data": "proxy@;tcapsvr@master#1",
    "Memo": "AddTableManual",
    "CreateUser": "tcaplus",
    "CreateTime": "2021-07-23 16:17:20",
    "UpdateTime": "2021-07-23 16:17:47",
    "CanRedo": 1,
    "CanSuspend": 1,
    "CanRollback": 1,
    "SetId": 1,
    "ExtendInfo": "",
    "MaxConcurrentCount": 10,
    "StatusText": "Successfully completed"
}
  1. An example of successfully getting the details of a table-modifying transaction
{
    "Id": 405,
    "AppId": 2,
    "ZoneId": 3,
    "Type": 281,
    "Status": 10,
    "CanRedo": 1,
    "CanSuspend": 1,
    "CanRol lback": 1,
    "Reason": 2,
    "Num": 0,
    "IdName": "test_table_generic_modify",
    "Data": "fc448894b1fc2e22ece9a6873b33c7b6",
    "Memo": "ModifyTable",
    "CreateUser": "tcaplus",
    "CreateTime": "2017-03-02 21:38:30",
    "UpdateTime": "2017-03-02 21:41:37",
    "SetId": 126,
    "ExtendInfo": "",
    "MaxConcurrentCount": 10
}
  1. An example of successfully getting the details of a table-truncating transaction
{
    "Id": 408,
    "AppId": 2,
    "ZoneId": 3,
    "Type": 279,
    "Status": 9,
    "CanRedo": 1,
    "CanSuspend": 1,
    "CanRollback": 1,
    "Reason": 0,
    "Num": 0,
    "IdName": "test_table_generic_modify",
    "Data": "",
    "Memo": "TruncateTable",
    "CreateUser": "tcaplus",
    "CreateTime": "2017-03-02 21:57:56",
    "UpdateTime": "2017-03-02 22:00:29",
    "SetId": 126,
    "ExtendInfo": "",
    "MaxConcurrentCount": 10
}
  1. An example of successfully getting the details of a table-deleting transaction
{
    "Id": 411,
    "AppId": 2,
    "ZoneId": 3,
    "Type": 363,
    "Status": 9,
    "CanRedo": 1,
    "CanSuspend": 1,
    "CanRollback": 1,
    "Reason": 0,
    "Num": 0,
    "IdName": "test_table_generic_modify",
    "Data": "",
    "Memo": "DeleteTable",
    "CreateUser": "tcaplus",
    "CreateTime": "2017-03-02 22:12:49",
    "UpdateTime": "2017-03-02 22:17:38",
    "SetId": 126,
    "ExtendInfo": "",
    "MaxConcurrentCount": 10
}

Failed Return Example

Status of http request != 200

{
    "name": "Unauthorized",
    "message": "You are requesting with an invalid credential.",
    "code": 0,
    "status": 401,
    "type": "yii\\web UnauthorizedHttpException"
}
{
    "trans_id": [
        "for the cmd(cmd:10004),can only get those transaction of which type is in 279,type of transaction(id:411) is 363"
    ]
}